/*
 *	Copyright 2011 ja4cli
 *
 *	Licensed under the Apache License, Version 2.0 (the "License");
 *	you may not use this file except in compliance with the License.
 *	You may obtain a copy of the License at
 *
 *		http://www.apache.org/licenses/LICENSE-2.0
 *
 *	Unless required by applicable law or agreed to in writing, software
 *	distributed under the License is distributed on an "AS IS" BASIS,
 *	WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *	See the License for the specific language governing permissions and
 *	limitations under the License.
 */
package org.skarby.ja4cli.conversion;

import org.skarby.ja4cli.Environment;

/**
 * Factory responsible for creating {@link ArgumentConverter}-objects.
 * 
 * @author askarby
 * @param <C> the type of converter the factory is able to create.
 * @param <P> the type of parameter providing configuration for constructing the converter.
 * 
 */
public interface ConverterFactory<C extends ArgumentConverter<?>, P> {

	/**
	 * Determines whether or not the factory can create a converter supporting conversion to the passed type.
	 * @param type the type to determine if is supported by the converter created.
	 * @return <code>true</code> if type is supported by the converter that can be created.
	 */
	boolean supports(Class<?> type);
	
	C create(Environment environment, P parameters);
}
